<?php
/** @var \Laravel\Lumen\Routing\Router $router */

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/
// 默认访问
$router->get('/', function () {
    return "请部署nginx访问pc端";
});

// 后端上传资源读取
$router->get('resources/{path}/{file}', function ($path, $file) {
    $path = storage_path('app/upload/' . $path . '/' . $file);
    if (!file_exists($path)) {
        throw new Exception('文件不存在');
    }
    return response()->file($path);
});

